<?php
include dirname(dirname(__FILE__))."/s_user-manage/s_user-verify.php";
include dirname(__FILE__)."/functions.php";
if(isset($_POST['submited'])&&$_POST['submited']==1) {
	$storeName=dowith_sql(addslashes($_POST["storeName"]));

	$params = array('s_user_id' =>$_SESSION["s_user_id"],
					'create_time'=>'"'.date("Y-m-d H:i:s").'"' );
	if (addAidApply($params)){
		
		 $applyId=mysql_insert_id();
		 $dir=$_SESSION["s_username"];
		 $params = array('create_time' =>'"'. date("Y-m-d H:i:s").'"',
		 			      'aid_apply_id'=>$applyId,
		 			      'store_name'=>'"'.$storeName.'"',
		 			      'dir'=>'"'.$dir.'"' );

		 if (addAccessory($params)) {
		 	alertInfo("申请成功,请等待审核", getHost()."/front-show/aid-apply/index.php");
		 	
		 }else {
		 	alertInfo("申请失败", getHost()."/front-show/aid-apply/index.php");
		 	
		 }
		
	}else {
		alertInfo("申请失败", getHost()."/front-show/aid-apply/index.php");
	}
}
?>